{% extends "base.html" %}
{% block content %}
<h1>Forbidden</h1>
<p>This is a 403 response from server</p>
<p>
  The view class only needs to define <code>response_builder</code> to
  override the standard HttpResponse
</p>
<div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">obviews.views</span> <span class="kn">import</span> <span class="n">View</span><span class="p">,</span> <span class="n">FormView</span>

<span class="c"># change type of response</span>
<span class="k">class</span> <span class="nc">ForbiddenView</span><span class="p">(</span><span class="n">View</span><span class="p">):</span>
    <span class="n">template_name</span> <span class="o">=</span> <span class="s">&quot;forbidden.html&quot;</span>
    <span class="n">response_builder</span> <span class="o">=</span> <span class="n">HttpResponseForbidden</span>

<span class="n">urlpatterns</span> <span class="o">=</span> <span class="n">patterns</span><span class="p">(</span><span class="s">&#39;&#39;</span><span class="p">,</span>
    <span class="p">(</span><span class="s">&#39;^forbidden/$&#39;</span><span class="p">,</span> <span class="n">ForbiddenView</span><span class="p">()),</span>
<span class="p">)</span>

</pre></div>
<p>
  Also it might look as any HTML page... look at the response headers
  and see the 403 status...  In <strong>next example</strong>, see how
  to break normal process and return any response <a
  href="/time/0/">at any time...</a>
</p>
{% endblock %}
